home *** CD-ROM | disk | FTP | other *** search
/ Amoszine 10 / Amoszine 10 (Disk 3 of 3).adf / Text_Files.lha / pp_lib_amos.txt7 < prev    next >
Text File  |  1995-12-11  |  1KB  |  66 lines

  1. On 2 Jul 95 you wrote to me:
  2.  
  3.  SS>    After seeing what you told Andrew Johnson about crunching files
  4.  SS> with powerpacker library, i thought wouldnt it be good if i could
  5.  SS> uncrunch files without resorting to such commands as 'PPload' which
  6.  
  7. This is what started the thread off in the first place! You need to
  8. use the ppLoadData function. Here is the code in my original reply to
  9. Andrew:
  10.  
  11. '--- Decrunch colours ---
  12. DCR_COL0=0
  13. DCR_COL1=1
  14. DCR_POINTER=2
  15. DCR_SCROLL=3
  16. DCR_NONE=4
  17.  
  18. '--- Memory types ---
  19. MEM_ANY=0
  20. MEM_CHIP=1
  21. MEM_FAST=2
  22.  
  23. '--- Global ppLoadData variables --- 
  24. PP_COLOUR=DCR_NONE
  25. PP_MEMTYPE=MEM_ANY
  26. PP_BUFFER=0
  27. PP_LENGTH=0
  28. Global PP_COLOUR,PP_MEMTYPE,PP_BUFFER,PP_LENGTH
  29.  
  30. PPREAD[Fsel$('')]
  31. If Param=0
  32.    Print "Loaded";PP_LENGTH;" bytes at ";Hex$(PP_BUFFER)
  33. Else 
  34.    Print "Error number ";Param
  35. End If 
  36.  
  37. '--- Free the memory (only if no errors) --- 
  38.  
  39. If Param=0
  40.    Lib Open 1,"exec.library",0
  41.    Areg(1)=PP_BUFFER
  42.    Dreg(0)=PP_LENGTH
  43.    RESULT=Lib Call(1,-210)
  44.    Lib Close 1 
  45. End If 
  46. End 
  47.  
  48. Procedure PPREAD[NAME$]
  49.    Lib Open 1,"powerpacker.library",0
  50.  
  51.    NAME$=NAME$+Chr$(0)
  52.    Areg(0)=Varptr(NAME$)
  53.    Dreg(0)=PP_COLOUR
  54.    Dreg(1)=PP_MEMTYPE
  55.    Areg(1)=Varptr(PP_BUFFER)
  56.    Areg(2)=Varptr(PP_LENGTH)
  57.    
  58.    RESULT=Lib Call(1,-30)
  59.    Lib Close 1
  60. End Proc[RESULT]
  61.  
  62. See ya,
  63. __
  64. |_)_ _ _|
  65. | (_|(_)l
  66.